This RMarkdown conducts initial time series analyses on two SNOTEL sites in the Chuska Mountains located in the Navajo Nation.
Read in packages
## # A tibble: 7 x 3
## variable n_miss pct_miss
## <chr> <int> <dbl>
## 1 snow_depth_mm 44 1.09
## 2 air_temp_max_C 29 0.718
## 3 air_temp_av_C 25 0.619
## 4 air_temp_min_C 25 0.619
## 5 swe_mm 15 0.371
## 6 precip_mm 1 0.0248
## 7 Date 0 0
The horizontal black bars in the lower left indicate the number of NAs total for each variable, with the variable name shown to the right of the corresponding horizontal bar
The vertical black lines with black dots indicate the variables between which the frequency of co-occurring NAs is indicated by the vertical black bars
## Warning: Removed 1 rows containing missing values (geom_path).
## Warning: Removed 7 rows containing missing values (geom_path).
## Warning: Removed 1 rows containing missing values (geom_path).
## Warning: Removed 1 rows containing missing values (geom_path).
## Joining, by = "Date"
## Warning: Removed 2049 rows containing missing values (geom_path).
stats
# correlation
cor.test(wc_snodas_snotel_wint$snodas_swe_mm, wc_snodas_snotel_wint$snotel_swe_mm)
##
## Pearson's product-moment correlation
##
## data: wc_snodas_snotel_wint$snodas_swe_mm and wc_snodas_snotel_wint$snotel_swe_mm
## t = 138.5, df = 1991, p-value < 0.00000000000000022
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9475146 0.9557866
## sample estimates:
## cor
## 0.9518235
# linear model
summary(lm(wc_snodas_snotel_wint$snodas_swe_mm ~ wc_snodas_snotel_wint$snotel_swe_mm))
##
## Call:
## lm(formula = wc_snodas_snotel_wint$snodas_swe_mm ~ wc_snodas_snotel_wint$snotel_swe_mm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -162.914 -2.551 7.540 11.540 154.245
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) -7.540085 0.954988 -7.895
## wc_snodas_snotel_wint$snotel_swe_mm 0.903722 0.006525 138.501
## Pr(>|t|)
## (Intercept) 0.00000000000000474 ***
## wc_snodas_snotel_wint$snotel_swe_mm < 0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 33.54 on 1991 degrees of freedom
## Multiple R-squared: 0.906, Adjusted R-squared: 0.9059
## F-statistic: 1.918e+04 on 1 and 1991 DF, p-value: < 0.00000000000000022
# root mean square error
rmse(wc_snodas_snotel_wint$snodas_swe_mm, wc_snodas_snotel_wint$snotel_swe_mm, na.rm = TRUE)
## [1] 38.86102
## Warning: Removed 2055 rows containing missing values (geom_path).
## Warning: Removed 5 rows containing non-finite values (stat_smooth).
## Warning: Removed 5 rows containing missing values (geom_point).
## Warning: Removed 5 rows containing non-finite values (stat_smooth).
## Warning: Removed 5 rows containing missing values (geom_point).
Stats
# correlation
cor.test(wc_snodas_snotel_wint$snodas_snow_depth_mm,
wc_snodas_snotel_wint$snotel_depth_mm)
##
## Pearson's product-moment correlation
##
## data: wc_snodas_snotel_wint$snodas_snow_depth_mm and wc_snodas_snotel_wint$snotel_depth_mm
## t = 108.05, df = 1986, p-value < 0.00000000000000022
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9177897 0.9305942
## sample estimates:
## cor
## 0.9244521
# linear model
summary(lm(wc_snodas_snotel_wint$snodas_snow_depth_mm ~
wc_snodas_snotel_wint$snotel_depth_mm))
##
## Call:
## lm(formula = wc_snodas_snotel_wint$snodas_snow_depth_mm ~ wc_snodas_snotel_wint$snotel_depth_mm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -728.50 -28.35 -8.05 66.11 432.95
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 8.045800 4.059523 1.982
## wc_snodas_snotel_wint$snotel_depth_mm 0.956939 0.008857 108.046
## Pr(>|t|)
## (Intercept) 0.0476 *
## wc_snodas_snotel_wint$snotel_depth_mm <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 140.5 on 1986 degrees of freedom
## (5 observations deleted due to missingness)
## Multiple R-squared: 0.8546, Adjusted R-squared: 0.8545
## F-statistic: 1.167e+04 on 1 and 1986 DF, p-value: < 0.00000000000000022
# root mean square error
rmse(wc_snodas_snotel_wint$snodas_snow_depth_mm,
wc_snodas_snotel_wint$snotel_depth_mm, na.rm = TRUE)
## [1] 141.2969
Timing of max swe
Stats
# correlation
cor.test(wc_snodas_snotel_monthly$snodas_swe_mm,
wc_snodas_snotel_monthly$snotel_swe_mm)
##
## Pearson's product-moment correlation
##
## data: wc_snodas_snotel_monthly$snodas_swe_mm and wc_snodas_snotel_monthly$snotel_swe_mm
## t = 29.938, df = 64, p-value < 0.00000000000000022
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9450476 0.9791755
## sample estimates:
## cor
## 0.9661015
# linear model
summary(lm(wc_snodas_snotel_monthly$snodas_swe_mm ~ wc_snodas_snotel_monthly$snotel_swe_mm))
##
## Call:
## lm(formula = wc_snodas_snotel_monthly$snodas_swe_mm ~ wc_snodas_snotel_monthly$snotel_swe_mm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -125.031 -6.249 7.945 14.933 69.251
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) -7.01771 5.95098 -1.179
## wc_snodas_snotel_monthly$snotel_swe_mm 0.95558 0.03192 29.938
## Pr(>|t|)
## (Intercept) 0.243
## wc_snodas_snotel_monthly$snotel_swe_mm <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 33.72 on 64 degrees of freedom
## Multiple R-squared: 0.9334, Adjusted R-squared: 0.9323
## F-statistic: 896.3 on 1 and 64 DF, p-value: < 0.00000000000000022
# root mean square error
rmse(wc_snodas_snotel_monthly$snodas_swe_mm,
wc_snodas_snotel_monthly$snotel_swe_mm, na.rm = TRUE)
## [1] 36.10355
## Warning: Removed 3 rows containing non-finite values (stat_smooth).
## Warning: Removed 3 rows containing missing values (geom_point).
## Parsed with column specification:
## cols(
## Date = col_date(format = ""),
## ppt = col_double()
## )
## Parsed with column specification:
## cols(
## Date = col_date(format = ""),
## tmean = col_double()
## )
## [1] "Adjusted R2 value is"
## [1] 0.3726921
## Adding missing grouping variables: `month`
## [1] "Adjusted R2 value is"
## [1] 0.8743605
Station ID: 1143
State: Arizona
Network: SNOTEL
County: Apache
Elevation: 9200 ft.
Latitude: 36.33
Longitude: -109.06
HUC: 140802040401
## Warning: Removed 30 rows containing missing values (geom_path).
## Warning: Removed 29 rows containing missing values (geom_path).
## Joining, by = "Date"
## Warning: Removed 2049 rows containing missing values (geom_path).
## Warning: Removed 2055 rows containing missing values (geom_path).
## Warning: Removed 8 rows containing non-finite values (stat_smooth).
## Warning: Removed 8 rows containing missing values (geom_point).
## Warning: Removed 8 rows containing non-finite values (stat_smooth).
## Warning: Removed 8 rows containing missing values (geom_point).
## Parsed with column specification:
## cols(
## Date = col_date(format = ""),
## ppt = col_double()
## )
## Parsed with column specification:
## cols(
## Date = col_date(format = ""),
## tmean = col_double()
## )
## [1] "Adjusted R2 value is"
## [1] 0.3869254
## Adding missing grouping variables: `month`
## [1] "Adjusted R2 value is"
## [1] 0.7111151
# combine with snotel data
bs_prism_snotel <- bs_prism_precip %>%
mutate(Date = ymd(Date)) %>%
rename(prism_ppt_mm = ppt) %>%
left_join(bs_clean_metric, by = "Date") %>%
select(Date, prism_ppt_mm, "snotel_ppt_mm" = precip_mm, snow_depth_mm, swe_mm)